<template lang="">
    <div class="recommendContainer">
        <el-tabs v-model="activeName" @tab-click="handClick">
            <!-- 第一个 -->
            <el-tab-pane v-if="menuList.includes('recommend')" name="recommend"  height="72vh">
                <span slot="label" class="tabPaneStyle"><i class="el-icon-user-solid "></i> 人才引荐管理</span>
                <el-form :inline="true" class="demo-form-inline padding" size="small">
                    <el-form-item label="岗位:">
                      <el-input v-model="params.name" placeholder="请输入" class="inputBorder" size="small"></el-input>
                    </el-form-item>
                    <el-form-item label="类别:" >
                      <el-select v-model="params.kind" placeholder="请选择" size="small">
                          <el-option label="内部" value="0"></el-option>
                          <el-option label="外部" value="1"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="姓名:">
                      <el-input v-model="params.introduceName" placeholder="请输入" size="small"></el-input>
                    </el-form-item>
                    <br>
                    <el-form-item style="float:right;margin-right:10px;">
                        <el-button type="primary" @click="reset" style="background:#4787E3FF">重置</el-button> 
                        <el-button type="primary" @click="onSubmit" style="background:#4787E3FF">查询</el-button>
                        <el-button type="primary" @click="onDelete" style="background:#4787E3FF">删除</el-button>
                    </el-form-item>
                </el-form>
                <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" :header-cell-style="{background:'#4787E3FF',color:'#fff'}" cell-class-name='cellStyle' height="72vh" style="width: 100%" @select="select" @select-all="selectAll" row-class-name="greyRow" header-row-class-name="strong">
                  <el-table-column type="selection" ></el-table-column>
                  <el-table-column prop="username" label="姓名" ></el-table-column>
                  <el-table-column prop="kindType" label="类别" ></el-table-column>
                  <el-table-column prop="jobName" label="推荐岗位" ></el-table-column>
                  <el-table-column prop="time" label="推荐时间" ></el-table-column>
                  <el-table-column prop="introduceUser" label="推荐人" ></el-table-column>
                  <el-table-column label="操作">
                      <template slot-scope="scope">
                          <el-button @click="handleClick(scope.row)" type="text" size="small" class="underline buttonStyle">查看</el-button>
                          <el-button @click="open(scope.row)" type="text" size="small" style="margin-right:10px;" class="underline buttonStyle">删除</el-button>
                          <a :href="scope.row.attachmentAddress" download="text.png" type="text" class="underline buttonStyle ">下载</a>
                      </template>
                  </el-table-column>
                </el-table>
                <!-- 分页 -->
                <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page.sync="currentPage"
                  :page-size="10"
                  layout="total, prev, pager, next"
                  background
                  :total="totalCount"
                  style="margin-left:750px;margin-top:10px;">
                </el-pagination>
                <Look :val="dialogVisible" :menuForm="menuForm"  @getMessage='close'></Look>
            </el-tab-pane>
            <!-- 第二个----------------------- -->
            <el-tab-pane v-if="menuList.includes('jobManage')"  name="jobManage"  height="72vh">
                <span slot="label" class="tabPaneStyle"><i class="el-icon-s-custom"></i> 岗位管理</span>
                <el-form :inline="true" class="demo-form-inline padding"  size="small">
                    <el-form-item label="岗位:">
                      <el-input v-model="params2.name" placeholder="请输入" class="inputBorder" size="small"></el-input>
                    </el-form-item>
                    <el-form-item label="部门:">
                      <el-select v-model="params2.deptName" placeholder="请选择" size="small">
                         <el-option 
                          v-for="(item,index) in deptTypes"
                          :key="index"
                          :label="item.name" 
                          :value="item.name">
                          </el-option>
                       </el-select> 
                    </el-form-item>
                    <el-form-item label="类别:">
                      <el-select v-model="params2.kind" placeholder="请选择" size="small">
                          <el-option label="内部" value="0"></el-option>
                          <el-option label="外部" value="1"></el-option>
                      </el-select>
                    </el-form-item>
                   </el-form>
                    <div style="float:right;margin-bottom:19px;margin-right:10px;">
                        <el-button type="primary" @click="addInfo" style="background:#4787E3FF" size="small">新建</el-button>
                       <el-button type="primary" @click="reset2" style="background:#4787E3FF" size="small">重置</el-button>                       
                        <el-button type="primary" @click="onSubmit2" style="background:#4787E3FF" size="small">查询</el-button>
                        <el-button type="primary" @click="onDelete2" style="background:#4787E3FF" size="small">删除</el-button>
                    </div>        
                <el-table ref="multipleTable" :data="tableData2" tooltip-effect="dark" :cell-style="cellStyle" :header-cell-style="{background:'#4787E3FF',color:'#fff'}" cell-class-name='cellStyle' height="72vh" style="width: 100%" @select="select" @select-all="selectAll" row-class-name="greyRow" header-row-class-name="strong">
                  <el-table-column type="selection" ></el-table-column>
                  <el-table-column prop="name" label="岗位" ></el-table-column>
                  <el-table-column prop="kindType" label="类别" ></el-table-column>
                  <el-table-column prop="deptName" label="部门" ></el-table-column>
                  <el-table-column prop="salary" label="薪资" ></el-table-column>
                  <el-table-column label="是否推荐" >
                      <template slot-scope="scope">
  <el-switch
    v-model="scope.row.switchValue"
    active-text="是"
    inactive-text="否"
    disabled
    @change="changeswitvh(value3)"
  ></el-switch>
</template>
                  </el-table-column>
                  <el-table-column label="操作">
                      <template slot-scope="scope">
  <el-button
    @click="handleClick2(scope.row)"
    type="text"
    class="underline buttonStyle"
    size="small"
  >查看</el-button>
  <el-button @click="modify(scope.row)" type="text" class="underline buttonStyle" size="small">修改</el-button>
  <el-button @click="open2(scope.row)" type="text" class="underline buttonStyle" size="small">删除</el-button>
</template>
                  </el-table-column>
                </el-table>
                <!-- 分页 -->
                <el-pagination
                  @size-change="handleSizeChange2"
                  @current-change="handleCurrentChange2"
                  :current-page.sync="currentPage2"
                  :page-size="10"
                  layout="total, prev, pager, next"
                  background
                  :total="totalCount2"
                  style="margin-left:750px;margin-top:10px;">
                </el-pagination>
                <!-- 对话框 -->
                <el-dialog :title="titleTip" :visible.sync="dialogVisible2" width="800px"   :before-close="closeDialog2">
                  <div class="detailsTip">
                     <div class="maninfo">{{jobmanage}}</div>
                  </div>
                  <el-form :inline="true" :model="menuForm2" class="demo-form-inline modi-icon" label-position="right" label-width="110px" :rules="rules" ref="ruleForm">
                    <el-form-item label="岗位名称"  prop="name">
                      <el-input v-model="menuForm2.name" placeholder="" style="width:215px;" size="small"></el-input>
                    </el-form-item>
                    <el-form-item label="类别"  class="phone" prop="kind">
                       <el-select v-model="menuForm2.kind" placeholder="请选择"  style="width:215px;" size="small">
                        <el-option label="内部" :value="0"></el-option>
                        <el-option label="外部" :value="1"></el-option>
                       </el-select>
                    </el-form-item>
                    <el-form-item label="部门名称"  prop="deptId">
                      <el-select v-model="menuForm2.deptId" placeholder="请选择"  style="width:215px;" size="small">
                         <el-option 
                          v-for="(item,index) in deptTypes"
                          :key="index"
                          :label="item.name"
                          :value="item.id">
                          </el-option>
                       </el-select>                       
                    </el-form-item>
                    <el-form-item label="薪资范围"  prop="fSalary">
                      <el-input v-model="menuForm2.fSalary" placeholder="" style="width:100px;" size="small"></el-input>~                        
                      <el-input v-model="menuForm2.eSalary" placeholder="" style="width:100px;" size="small"></el-input>K                      
                    </el-form-item>
                    <el-form-item label="工作年限"  prop="jobTime">
                      <el-select v-model="menuForm2.jobTime" placeholder="请选择"  style="width:215px;" size="small">
                        <el-option label="1-2" value="1-2"></el-option>
                        <el-option label="3-5" value="3-5"></el-option>
                        <el-option label="6-8" value="6-8"></el-option>
                      </el-select>                                           
                    </el-form-item>
                    <el-form-item label="学历要求"  prop="edu">
                       <el-select v-model="menuForm2.edu" placeholder="请选择"  style="width:215px;" size="small">
                        <el-option label="大专" :value="0"></el-option>
                        <el-option label="本科" :value="1"></el-option>
                        <el-option label="硕士" :value="2"></el-option>
                        <el-option label="博士" :value="3"></el-option>
                        <el-option label="其他" :value="4"></el-option>
                      </el-select>                       
                    </el-form-item>
                    <el-form-item label="是否推荐"  >
                      <el-switch 
                         v-model="menuForm2.svalue3" 
                         @change="changeswitvh(menuForm2.svalue3)"
                         style="margin-right:177px;"
                         >
                      </el-switch>                      
                    </el-form-item>
                    <el-form-item label="工作城市"  prop="city">
                      <el-input v-model="menuForm2.city" placeholder="" style="width:215px;" size="small"></el-input>                        
                    </el-form-item>
                    <el-form-item class="init-label is-required" label="职位亮点"  >
                      <el-tag
                        :key="tag"
                        v-for="tag in dynamicTags"
                        closable
                        :disable-transitions="false"
                        @close="handleClose(tag)">
                        {{tag}}
                      </el-tag>
                      <el-input
                        class="input-new-tag"
                        v-if="inputVisible"
                        v-model="inputValue"
                        ref="saveTagInput"
                        size="small"
                        @keyup.enter.native="handleInputConfirm"
                        @blur="handleInputConfirm"
                      >
                      </el-input>
                      <el-button v-else class="button-new-tag" size="small" @click="showInput" >+ </el-button>
                      <!-- <el-select v-model="menuForm2.lightPoint" placeholder="请输入" style="margin-right:363px;">
                        <el-option label="五险一金" value="五险一金"></el-option>
                        <el-option label="年终奖" value="年终奖"></el-option>
                      </el-select> -->
                      <!-- <el-input v-model="menuForm2.lightPoint" placeholder="请输入" style="margin-right:363px;"></el-input>                         -->
                    </el-form-item>
                    <el-form-item label="工作地址"  prop="address">
                      <el-input v-model="menuForm2.address" placeholder="请输入" style="margin-right:363px;" size="small"></el-input>                        
                    </el-form-item>
                    <el-form-item label="职位说明"  prop="jobDuty">
                      <div class="postdec">
                        <el-input v-model="menuForm2.jobDuty" placeholder="请输入岗位职责" style="margin-right:363px;" size="small">    
                        </el-input> 
                      </div>
                      <div class="postdec">
                        <el-input v-model="menuForm2.welfare" placeholder="请输入福利待遇" style="margin-right:363px;" size="small">
                        </el-input> 
                      </div>                                            
                    </el-form-item>
                  </el-form>
                  <span slot="footer" class="dialog-footer">
                    <el-button v-if="isAdd==false&&isModify==false"  @click="closeDialog2" type="primary" size="small">返回</el-button>
                    <el-button v-if="isAdd==true || isModify==true" @click="cancel" size="small">取 消</el-button>
                    <el-button v-if="isAdd==true || isModify==true" type="primary" @click="submitInfo()" size="small">确 定</el-button>
                  </span>
                </el-dialog>
            </el-tab-pane>
        </el-tabs> 
        <div class="login-info-box flex-row">
          <div class="picture">
            <img src="@/assets/homePicture/userpicture.png">
          </div>
          <div class="login-info">
              <p>欢迎您，{{username}}</p>
          </div>
      </div>
    </div>
</template>

<script>
import Look from "./actions/look";
import { Message } from "element-ui";
import { log } from 'util';
export default {
  data() {
    return {
      username: "",
      rules: {
        name: [{ required: true, message: "请输入岗位名称", trigger: "blur" }],
        kind: [{ required: true, message: "请选择类别", trigger: "change" }],
        deptId: [
          { required: true, message: "请选择部门名称", trigger: "change" }
        ],
        fSalary: [
          { required: true, message: "请输入薪资范围", trigger: "blur" }
        ],
        jobTime: [
          { required: true, message: "请选择工作年限", trigger: "change" }
        ],
        edu: [{ required: true, message: "请选择学历要求", trigger: "change" }],
        city: [{ required: true, message: "请输入工作城市", trigger: "blur" }],
        address: [
          { required: true, message: "请输入工作地址", trigger: "blur" }
        ],
        jobDuty: [
          { required: true, message: "请输入职位说明", trigger: "blur" }
        ]
      },
      jobmanage: "",
      titleTip: "",
      dynamicTags: [],
      inputVisible: false,
      inputValue: "",
      activeName: "first",
      isAdd: false, //区别是新增还是修改
      isModify: false, //
      dialogVisible: false, //人才引荐
      dialogVisible2: false, //岗位
      menuForm: {}, //人才引荐对话框
      menuForm2: {}, //岗位对话框
      tableData: [], //人才引荐管理表格数据
      tableData2: [], //岗位管理表格数据
      multipleSelection: [], //多选数组
      id: 0,
      ids: [], //删除选择的数组
      params: {
        //人才引荐参数
        name: "",
        kind: "",
        introduceName: "",
        page: 1,
        pageSize: 10
      },
      params2: {
        //岗位管理参数
        name: "",
        kind: "",
        deptName: "",
        page: 1,
        pageSize: 10
      },
      currentPage: 1,
      currentPage2: 1,
      totalCount: 0, // 总条数
      totalCount2: 0, // 总条数
      activeIndex: "1",
      value3: false, //switch开关
      deptTypes: [], //部门信息
      postm_id: 0, //修改数据的id值
      menuList: [],
      studyList: ["recommend", "jobManage"]
    };
  },
  mounted() {
    let menuList = localStorage.getItem("menuList");
    let initMenuList = JSON.parse(menuList);
    let studyList = this.studyList;
    this.menuList = initMenuList.permissions.tabPages;
    let studyListObj = initMenuList.permissions.tabPages;
    let realStudyList = studyList.filter(
      item => studyListObj.indexOf(item) > -1
    );
    this.activeName = realStudyList[0];
    this.username = initMenuList.username;
    console.log(realStudyList);
  },
  methods: {
    //薪资变颜色
    cellStyle({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 4) {
        //指定坐标
        return "color:#409EFF";
      } else {
        return "";
      }
    },
    //tag标签
    handleClose(tag) {
      this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
    },
    showInput() {
      this.inputVisible = true;
      this.$nextTick(_ => {
        this.$refs.saveTagInput.$refs.input.focus();
      });
    },
    handleInputConfirm() {
      if (this.inputValue.length > 10) {
        Message({
          type: "warning",
          message: "输入的长度不能超过10位"
        });
      } else {
        let inputValue = this.inputValue;
        if (inputValue) {
          this.dynamicTags.push(inputValue);
        }
        this.inputVisible = false;
        this.inputValue = "";
      }
    },
    //tab栏切换
    handClick(tab, event) {
      this.getRecommendList(); //人才引荐管理
      this.getPositionList(); // 岗位管理
      this.getDeptInfo();
    },
    //重置人才引荐管理
    reset() {
      this.params.name = "";
      this.params.kind = "";
      this.params.introduceName = "";
      this.getRecommendList();
    },

    //重置岗位管理
    reset2() {
      this.params2.name = "";
      this.params2.deptName = "";
      this.params2.kind = "";
      this.getPositionList();
    },
    //得到人才引荐管理表格数据
    async getRecommendList() {
      const { data: res } = await this.$http.post(
        "/recruitment_pc/qryIntroducePc",
        this.params
      );
      console.log("表格", res);
      for (let i = 0; i < res.data.recruitmentBackPCS.length; i++) {
        //处理时间戳
        let timer = res.data.recruitmentBackPCS[i].time;
        var date = new Date(parseInt(timer));
        var Y = date.getFullYear() + "/";
        var M =
          (date.getMonth() + 1 < 10
            ? "0" + (date.getMonth() + 1)
            : date.getMonth() + 1) + "/";
        var D =
          date.getDate() + 1 < 10
            ? "0" + (date.getDate() + 1)
            : date.getDate() + 1;
        res.data.recruitmentBackPCS[i].time = Y + M + D;
        //判断类别
        if (res.data.recruitmentBackPCS[i].kind == 0) {
          res.data.recruitmentBackPCS[i].kindType = "内部";
        } else {
          res.data.recruitmentBackPCS[i].kindType = "外部";
        }
      }
      this.tableData = res.data.recruitmentBackPCS;
      this.totalCount = res.data.totals;
    },
    //得到岗位管理表格数据
    async getPositionList() {
      const { data: res } = await this.$http.post(
        "/recruitment_pc/qryRecruitmentListPC",
        this.params2
      );
      for (let i = 0; i < res.data.recBacks.length; i++) {
        //判断类别
        if (res.data.recBacks[i].kind == 0) {
          res.data.recBacks[i].kindType = "内部";
        } else {
          res.data.recBacks[i].kindType = "外部";
        }
        //薪资
        res.data.recBacks[i].salary =
          res.data.recBacks[i].fSalary +
          "-" +
          res.data.recBacks[i].eSalary +
          "k";
        // 是否推荐
        if (res.data.recBacks[i].recommended == 0) {
          res.data.recBacks[i].switchValue = false;
        } else {
          res.data.recBacks[i].switchValue = true;
        }
      }
      this.tableData2 = res.data.recBacks;
      this.totalCount2 = res.data.totals;
    },
    //分页-人才引荐
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      this.params.page = val;
      this.getRecommendList();
    },
    //分页-岗位管理
    handleSizeChange2(val) {
      // console.log(`每页 ${val} 条`);
    },
    handleCurrentChange2(val) {
      this.params2.page = val;
      this.getPositionList();
    },
    //查询--人才引荐
    onSubmit() {
      this.getRecommendList();
    },
    //查询--岗位管理
    onSubmit2() {
      this.getPositionList();
    },
    //批量删除信息-人才引荐
    async onDelete() {
      if (this.ids.length == 0) {
        Message({
          message: "请选择删除项!",
          type: "warning",
          duration: 1000
        });
        return;
      }
      this.$confirm("此操作将删除该文件, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(async () => {
        const { data: res } = await this.$http.post(
          "/recruitment_pc/deleteIntroduceByList",
          this.ids
        );
        if (res.success == true) {
          this.getRecommendList();
        }
      }).catch(() => {});
      
    },
    //批量删除信息-岗位管理
    async onDelete2() {
      if (this.ids.length == 0) {
        Message({
          message: "请选择删除项!",
          type: "warning",
          duration: 1000
        });
        return;
      }
      this.$confirm("此操作将删除该文件, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(async () => {
        const { data: res } = await this.$http.post(
          "/recruitment_pc/deleteRecruitementByIds",
          this.ids
        );
        if (res.success == true) {
          this.getPositionList();
        }
      });
    },
    //多选
    select(selection) {
      let a = [];
      selection.forEach(item => {
        a.push(item.id);
      });
      this.ids = a;
    },
    //全选
    selectAll(selection) {
      let a = [];
      selection.forEach(item => {
        a.push(item.id);
      });
      this.ids = a;
    },
    //查看人才引荐
    async handleClick(row) {
      this.dialogVisible = true;
      // 获取应聘信息详情
      const { data: res } = await this.$http.get(
        "/recruitment_pc/qryIntroducePcById",
        { params: { id: row.id } }
      );
      this.menuForm = res.data;
      if (row.kind == 0) {
        //内部
        this.menuForm.kind = 0;
      } else {
        //外部
        this.menuForm.kind = 1;
      }
      this.menuForm.time = row.time;
      if (this.menuForm.edu == 0) {
        this.menuForm.edu = "大专";
      } else if (this.menuForm.edu == 1) {
        this.menuForm.edu = "本科";
      } else if (this.menuForm.edu == 2) {
        this.menuForm.edu = "硕士";
      } else {
        this.menuForm.edu = "博士";
      }
      // this.menuForm.edu = this.menuForm.edu == 1 ? "本科" : "大专";
    },
    //查看岗位管理
    async handleClick2(row) {
      this.jobmanage = "岗位详细信息";
      // this.postm_id = row.id;
      this.titleTip = "岗位查看";
      this.dialogVisible2 = true;
      this.isAdd = false;
      this.isModify = false;
      //获取详细信息
      const { data: res } = await this.$http.get(
        "/recruitment_pc/qryRecruitmentById",
        { params: { id: row.id } }
      );
      // console.log(row.switchValue);
      
      res.data.svalue3 = row.switchValue;
      this.menuForm2 = res.data;
      if (res.data.lightPoint == "") {
        this.dynamicTags = [];
      } else {
        this.dynamicTags = res.data.lightPoint.split(",");
      }
    },
    cancel() {
      this.dialogVisible2 = false;
      this.dynamicTags = [];
      this.$refs["ruleForm"].resetFields();
    },
    closeDialog2() {
      this.dialogVisible2 = false;
      this.dynamicTags = []; //将职位亮点置空
      this.$refs["ruleForm"].resetFields();
    },
    close(val) {
      this.dialogVisible = val;
    },
    //删除单条信息-人才引荐
    async open(row) {
      this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        center: true
      })
        .then(async () => {
          this.id = row.id;
          const { data: res } = await this.$http.get(
            "/recruitment_pc/deleteByIntroduceId",
            { params: { id: this.id } }
          );
          if (res.data == 1) {
            this.$message({
              type: "success",
              message: "删除成功!"
            });
            this.getRecommendList();
          }
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });

      // this.id = row.id;
      // const { data: res } = await this.$http.get(
      //   "/recruitment_pc/deleteByIntroduceId",
      //   { params: { id: this.id } }
      // );
      // if (res.data == 1) {
      //   Message({
      //     message: "删除成功",
      //     type: "success",
      //     duration: 1000
      //   });
      //   this.getRecommendList();
      // }
    },
    //删除单条信息-岗位管理
    open2(row) {
      this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        center: true
      })
        .then(async () => {
          this.id = row.id;
          const { data: res } = await this.$http.get(
            "/recruitment_pc/deleteRecruitmentById",
            { params: { id: this.id } }
          );
          if (res.data == 1) {
            this.$message({
              type: "success",
              message: "删除成功!"
            });
            this.getPositionList();
          }
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });

      // if (res.data == 1) {
      //   Message({
      //     message: "删除成功",
      //     type: "success",
      //     duration: 1000
      //   });
      //   this.getPositionList();
      // }
    },
    //新增岗位管理
    addInfo() {
      this.jobmanage = "录入岗位信息";
      this.isAdd = true;
      this.isModify = false;
      this.dialogVisible2 = true;
      this.titleTip = "添加岗位";
      this.menuForm2 ={ recommended:  0 };
    },
    //修改岗位管理
    modify(params) {
      this.postm_id = params.id;
      // console.log(params.id);
      
      this.handleClick2(params);
      this.isModify = true;
      this.isAdd = false;
      this.titleTip = "岗位变更";
      this.dialogVisible2 = true;
      this.jobmanage = "修改岗位信息";
       this.value3=params.switchValue==true?1:0
    },
    //得到部门id
    async getDeptInfo() {
      const { data: res } = await this.$http.get("course/qryDeptMessage", {
        params: { id: "" }
      });
      this.deptTypes = res.data;
    },
    //控制switch开关
    changeswitvh(value) {
      console.log(value);
      if (value == true) {
        this.menuForm2.recommended = 1;
      } else {
        this.menuForm2.recommended = 0;
      }
    },
    // 提交信息
    submitInfo() {
      this.$refs["ruleForm"].validate(async valid => {
        if (valid) {
          //是新增
          if (this.dynamicTags.length == 0) {
            Message({
              message: "请添加职位亮点",
              type: "warning",
              duration: 1500
            });
            return;
          }
          if (this.dynamicTags.length > 1) {
            this.menuForm2.lightPoint = this.dynamicTags.join(",");
          } else if ((this.dynamicTags.length = 1)) {
            this.menuForm2.lightPoint = this.dynamicTags[0];
          } else {
            this.menuForm2.lightPoint = "";
          }

          if (this.isAdd) {
            let params3 = {
              name: this.menuForm2.name,
              deptId: this.menuForm2.deptId,
              eSalary: this.menuForm2.eSalary,
              fSalary: this.menuForm2.fSalary,
              recommended: this.menuForm2.recommended,
              edu: this.menuForm2.edu,
              jobTime: this.menuForm2.jobTime,
              jobDuty: this.menuForm2.jobDuty,
              kind: this.menuForm2.kind,
              city: this.menuForm2.city,
              lightPoint: this.menuForm2.lightPoint,
              address: this.menuForm2.address,
              introduceName: this.menuForm2.introduceName,
              welfare: this.menuForm2.welfare
            };
            if (
              Number(this.menuForm2.fSalary) > Number(this.menuForm2.eSalary)
            ) {
              Message({
                message: "薪资范围输入有误",
                type: "warning",
                duration: 1500
              });
              return;
            }
            const { data: res } = await this.$http.post(
              "/recruitment_pc/insertRecruitment",
              params3
            );
            if (res.success) {
              Message({
                message: "操作成功",
                type: "success",
                duration: 1000
              });
              this.dialogVisible2 = false;
              this.menuForm2.lightPoint = "";
              this.getPositionList();
              this.dynamicTags = [];
              this.$refs["ruleForm"].resetFields();
            }
          }
          //是修改
          if (this.isModify) {
            // console.log(this.value3);
            this.menuForm2.recommended=this.menuForm2.svalue3==true?1:0
            let params3 = {
              id: this.postm_id,
              name: this.menuForm2.name,
              deptId: this.menuForm2.deptId,
              eSalary: this.menuForm2.eSalary,
              fSalary: this.menuForm2.fSalary,
              recommended: this.menuForm2.recommended,
              edu: this.menuForm2.edu,
              jobTime: this.menuForm2.jobTime,
              jobDuty: this.menuForm2.jobDuty,
              kind: this.menuForm2.kind,
              city: this.menuForm2.city,
              lightPoint: this.menuForm2.lightPoint,
              address: this.menuForm2.address,
              introduceName: this.menuForm2.introduceName,
              welfare: this.menuForm2.welfare
            };
            const { data: res } = await this.$http.post(
              "/recruitment_pc/updateRecruitment",
              params3
            );
            if (
              Number(this.menuForm2.fSalary) > Number(this.menuForm2.eSalary)
            ) {
              Message({
                message: "薪资范围输入有误",
                type: "warning",
                duration: 1500
              });
              return;
            }
            if (res.success) {
              Message({
                message: "修改成功",
                type: "success",
                duration: 1000
              });
              this.dialogVisible2 = false;
              this.dynamicTags = [];
              this.getPositionList();
              this.$refs["ruleForm"].resetFields();
            }
          }
        } else {
          return false;
        }
      });
    }
  },
  created() {
    this.getRecommendList(); //人才引荐管理
    this.getPositionList(); // 岗位管理
    this.getDeptInfo();
  },
  components: {
    Look: Look
  }
};
</script>

<style lang="less" scoped>
/deep/.el-switch__label * {
  font-size: 16px;
}
/deep/.el-form-item__label {
  font-size: 16px;
  color: #606266;
}
.padding {
  padding-left: 60px !important;
  margin-top: 25px;
}
.detailsTip {
  .maninfo {
    width: 90px;
    height: 38px;
    border-bottom: 2px solid rgba(71, 135, 228, 1);
  }
}
.init-label.is-required:not(.is-no-asterisk)
  > .el-form-item__label:before:before {
  content: "*";
  color: #f56c6c;
  margin-right: 4px;
}
a:link {
  color: #409eff;
}
a:visited {
  color: #409eff;
}
.postdec {
  background: rgba(255, 255, 255, 1);
  margin-bottom: 8px;
}
.recommendContainer {
  position: relative;
  height: 100%;
  overflow: auto;
  background-color: #fff;
  margin-top: 4px;
  padding: 20px 0 0 30px;
}
.is-active {
  background-color: #fff !important;
}
.recommendContainer {
  padding-top: 0;
  padding-left: 15px;
  padding-right: 15px;
}
.barTop {
  margin-bottom: 10px;
}

.detailsTip {
  margin-top: -6px;
  margin-bottom: 10px;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  height: 38px;
  line-height: 38px;
  color: #4787e4ff;
  padding-left: 20px;
}
.modi-icon .el-form-item__label:before {
  color: blue !important;
  margin-right: 25px !important;
}

/deep/.el-dialog__footer {
  text-align: center !important;
}

.login-info-box {
  position: absolute;
  top: 8px;
  right: 15px;
}
.picture {
  width: 25px;
  height: 25px;
  margin-right: 10px;
  border-radius: 50%;
  background-color: antiquewhite;
}
.login-info {
  p {
    line-height: 15px;
    font-size: 13px;
    font-weight: 300;
    color: rgba(102, 102, 102, 1);
  }
}

.el-tag + .el-tag {
  margin-left: 10px;
}
.button-new-tag {
  margin-left: 10px;
  height: 32px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}
.input-new-tag {
  width: 90px;
  margin-left: 10px;
  vertical-align: bottom;
}
.el-pagination {
  float: right;
}
.demo-form-inline {
  padding-left: 60px;
}
</style>
<style lang="less">
.greyRow {
  background-color: #f7f7f7 !important;
  border-bottom: 13px solid #fff;
}

.recommendContainer {
  font-family: "Microsoft YaHei";
  .el-table td,
  .el-table th.is-leaf {
    border-bottom: 13px solid #fff;
  }
}
.underline {
  text-decoration: underline;
  font-size: 12px;
  span {
    text-decoration: underline;
  }
}
.strong th > .cell {
  font-weight: 700;
}
/* .el-dialog__headerbtn {
  display: none;
} */
// .cellStyle{
//   font-size: 16px;
//   color: #000;
//   opacity: 0.7;
// }
.buttonStyle {
  font-size: 16px;
  opacity: 1 !important;
}
.tabPaneStyle {
  font-size: 18px;
}
.el-dialog__title {
  color: #222;
}
.el-dialog__header {
  padding: 20px 20px 20px;
}
</style>